<include file="Public/head" />

<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> {:L("jiaohaochuli")}</strong></div>
    <table class="table table-hover text-center">
      <tr>
        <th width="10%">{:L("haoshu")}</th>
        <th width="20%">{:L("canzhuoleixing")}</th>
        <th width="10%">{:L("caozuo")}</th>
      </tr>
      <foreach name="info" item="v">
        <tr class="{$v['id']}">
          <td>{$v['get_num']}</td>
          <td>{$v['table_cate_name']}</td>
          <td>
            <div class="button-group">
              <if condition="$v['status'] == 0">
                <span style="color: blue; cursor: pointer; text-decoration: underline;"
                      onclick="is_eat({$v['id']},this)">{:L("daijiucan")}</span>
                <elseif condition="$v['status'] == 1"/>
                <span style="color: green;">{:L("yijiucan")}</span>
              </if>
            </div>
          </td>
        </tr>
      </foreach>
      <tr>
        <td colspan="10">
          <div class="pagelist">{$show}</div>
        </td>
      </tr>
    </table>
  </div>
  <script type="text/javascript">
    function is_eat(id, t) {
      if (confirm("{:L('gaiweijiucan')}")) {
        var url = "{:U('Getnum/is_eat')}";
        $.getJSON(url, {id: id}, function (data) {
          if (data.result == 'yes') {
            var p = $(t).parent();
            $(t).remove();
            p.prepend('<span style="color: green;">{:L("yijiucan")}</span>');
          }
        })
      }
    }
  </script>
</body>

</html>